Código fuente de 'Filtro en arrays.asp'

<html>

<head>
<title>Filtro en arrays - Códigos asp, programacion asp, descargas asp, rutinas asp</title>
</head>

<p align="center"><b><font size="3">Filtro en arrays</font></b>
<body style="font-family: Arial; font-size: 11pt"></p>

<%'Create an array of names
Dim aNames
aNames = Array("Scott", "Steve", "Yves", "Charles", _
               "Ian", "Mike", "Christopher", "Roger", _
               "Josh", "Kevin", "David", "Isaac", "John")

'List the complete list of names:
Response.Write "<b>La lista de nombres contiene:</b><br>"
Response.Write join(aNames, ", ")

'Now, filter on a certain character
Response.Write "<p><b>Los nombres que contienen la " & _
               "letra 's':</b><br>"

Dim aNamesWithS
aNamesWithS = Filter(aNames, "s", True, vbTextCompare)
Response.Write join(aNamesWithS, ", ")


'Now, filter and display on another character
Response.Write "<p><b>Los nombres que <i>NO</i> " & _
               "contienen la letra 'c':</b><br>"
Response.Write join(Filter(aNames, "c", False, vbTextCompare), ", ")

%>
</body>
</html>